package com.example.docking.service.impl;

import com.example.docking.dao.jindie.GenericDataItem;
import com.example.docking.dao.jindie.ResponseData;
import com.example.docking.dao.jindie.response.BomData;
import com.example.docking.service.BomService;
import com.example.docking.util.Constants;
import com.google.gson.Gson;
import com.smecloud.apigw.model.ApiResult;

public class BomServiceImpl extends BaseServiceImpl implements BomService {
    @Override
    public ApiResult SelectBom() throws Exception {
        return sendApiRequestGet(Constants.BOM, map, "");
    }

    public static void main(String[] args) throws Exception {
        Gson gson = new Gson();
        BomService service = new BomServiceImpl();
        ApiResult result = service.SelectBom();
        ResponseData<GenericDataItem<BomData>> response = gson.fromJson(result.getBody(), ResponseData.class);
        System.out.println("Code: " + response.getErrcode());
        System.out.println("Message: " + response.getDescription());
        System.out.println("data: " + response.getData());

    }
}
